import VueRouter from "vue-router";
import Vue from "vue";

// 注册路由组件
Vue.use(VueRouter);

// 路由表
let routes = [
  {
    name: "layout",
    path: "/",
    redirect: "/home",
    component: () => import("@/view/layout.vue"),
    children: [
      {
        name: "home",
        path: "/home",
        component: () => import("@/view/home"),
      },{
        name: "wealth",
        path: "/wealth",
        component: () => import("@/view/wealth"),
      },
      {
        name: "living",
        path: "/living",
        component: () => import("@/view/living"),
      },
      {
        name: "rural",
        path: "/rural",
        component: () => import("@/view/rural"),
      },
      {
        name: "my",
        path: "/my",
        component: () => import("@/view/my"),
      },
    ],
  },
];

let router = new VueRouter({
  routes,
});

export default router;
